<div>
    <form  #formRef="ngForm" (submit)="login(formRef.value);">
        <mdl-textfield type='text' label="Username..."
            name="username" floating-label required [(ngModel)]="username"
            #usernameRef="ngModel">
        </mdl-textfield>
        <div *ngIf="auth?.hasError">
            {{auth?.errMsg}}
        </div>
        <mdl-textfield type='password' label="Password..."
            name="password" floating-label required [(ngModel)]="password"
            #passwordRef="ngModel">
        </mdl-textfield>
        <button mdl-button mdl-button-type="raised"
            mdl-colored="primary"
            mdl-ripple type="submit">
            登录
        </button>
        <!--
        <fieldset ngModelGroup="login">
            用户名:<input class="form-control" #usernameRef="ngModel" name="username" required minlength="3" type="text" [(ngModel)]="username">
            {{usernameRef.errors | json}}
            <div *ngIf="usernameRef.errors?.minlength">没有达到3个字符以上</div>
            <br> 密码：
            <input class="form-control" #passwordRef="ngModel" name="password" required type="password" [(ngModel)]="password">
            {{passwordRef.errors | json}}
            <br>
            <button class="btn btn-primary" type="submit">登录</button>
            <button class="btn btn-danger" type="button" (click)="logout();">登出</button>
        </fieldset>-->
    </form>
</div>
